var nconf = require('nconf');
var path = require('path');
function Config() {
    nconf.argv().env('_');
    var environment = nconf.get('NODE:ENV') || 'development';
    nconf.file(environment, __dirname+'/' + environment.toLowerCase() + '.json');
    nconf.file('default', __dirname+'/default.json');
}

Config.prototype.get = function (key) {
    return nconf.get(key);
};

module.exports = new Config();
